home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1988 December
/
Ahoy_Magazine_88-12_1988_Double_L.d64
/
Unjumbled Words
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
460b
|
15 lines
0 poke53280,1:print"[147]"tab(12)"unjumbled words"
1 rem ==================================
2 rem commodares problem #55-3 :
3 rem unjumbled words
4 rem solution by
5 rem wallace leeker
6 rem (based on a solution to
7 rem problem #24-1 by allan flippin)
8 rem ==================================
100 input s$: n=len(s$): dim c(n-1)
110 i=n-1: print s$,
120 s$=left$(s$,i-1)+right$(s$,n-i)+mid$(s$,i,1)
130 c(i)=c(i)+1: if c(i)<=n-i goto 110
140 c(i)=0: if i>1 then i=i-1: goto 120